import { defineStore } from 'pinia';

export const useGaTaskStore = defineStore('gaTask', {
  state: () => {
    return {
      currentTask: null as any,
      executeTask: null as any,
      taskId: '', // 任务id，用于监听任务开始，单一变量降低监听负担
    };
  },
  actions: {
    setCurrentTask(task: any) {
      this.$state.currentTask = task;
    },
    setExecuteTask(task: any) {
      this.$state.executeTask = task;
    },
    setTaskId(status: string) {
      this.$state.taskId = status;
    },
  },
});
